|
XPath 3 is the latest version of the XML Path Language, a query language for selecting nodes in XML documents. It supersedes XPath 1.0 and XPath 2.0. XPath 3.0 became a W3C Recommendation on 8 April 2014, while XPath 3.1 became a W3C Candidate Recommendation on 18 December 2014. == New features in XPath 3.0 == Compared to XPath 2.0, XPath 3.0 adds the following new features: ; Inline function expressions : Anonymous functions can be created in an expression context. For example, the expression function($a as xs:double, $b as xs:double) as xs:double creates a function that returns the product of its two arguments. The expression collection()/(let $a := . return function() ) creates a sequence of functions, each one returning a different node from a collection.; Dynamic function calls : Function values may be called without being referenced by name. For example, $f()("Hi there") fetches the second item from sequence $f , and invokes it as a function, passing the string "Hi there" as argument.; Union types : Union types, as defined in XML Schema, may be used in type conversions and function type signatures. ; Namespace literals : XML namespaces may be referenced using braced URI literals. For example, the qualified name math:pi may be expanded to , embedding the namespace URI inside the prefix.; String concatenation operator : The new || operator may be used for string concatenation: $a || $b is equivalent to fn:concat($a, $b) .; Mapping operator : The new ! operator performs simple mapping: E1 ! E2 evaluates E2 for each item in the sequence E1 , and concatenates the resulting items. This is comparable to the path operator / , but the ! operator does not perform duplicate elimination and document ordering of the results.抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「XPath 3」の詳細全文を読む スポンサード リンク
|